package br.com.caelum.jdbc;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

public class TestaRemocao {

	public static void main(final String[] args) throws SQLException {
		final Connection connection = new ConnectionPool().getConnection();

		final Statement statement = connection.createStatement();
		final boolean result = statement.execute("delete from Produto where id > 3");
		System.out.println("result: " + result);

		final int count = statement.getUpdateCount();
		System.out.println(count + " linhas atualizadas");

		statement.close();
		connection.close();
	}

}
